How to Export Unity Models Into Android Application (Mac OS X)


In order to export Unity into Android application, there are several steps that need to be done:

Install Android SDK
Note: Make sure you scroll down the web page and look for ‘Get just the command line tools’



external image image?w=624&h=254&rev=14&ac=1
Figure 1: How to find the correct SDK tool package for Mac OS X
  • Download the file from Mac OS X.

  • To install the SDK tools package into your system, access the folder ‘tools’ and double click on ‘android’. See Figure 2 for details


external image image?w=373&h=460&rev=18&ac=1
Figure 2: How to install SDK tools package into your computer system

  • This will bring up the Android SDK Manager window. See Figure 3.
Note: Make sure that at least one Android platform with API level equal to or higher than 9, Platform Tools, and USB Drivers (only for Windows) are selected and installed


external image image?w=357&h=258&rev=16&ac=1
Figure 3: What to install from Android SDK Manager
Install JDK

external image image?w=357&h=348&rev=7&ac=1
Figure 4: Download and Installing JDK

Android Device Configuration

  • Turn your android phone from Standard Mode to Developer Mode by:
    • Access Settings → System → About Device → Build Number (Tap 7 times). This will change your phone from Standard Mode to Developer Mode

  • Turn on USB Debugging in your android phone by (ONLY work when you are in Developer Mode)
    • Access Settings → System → Developer Options → Enable ‘USB debugging’

Configuring Settings in Unity to Make It Compatible to Android System

  • Check that the SDK and JDK a properly loaded into Unity by clicking ‘Unity’ → ‘Preferences’ → ‘External Tools’. See Figure 5.


external image image?w=385&h=320&rev=9&ac=1
Figure 5: Check SDK and JDK is properly loaded to Unity

Note:
  • To load SDK into Unity, locate your ‘android-sdk-macosx’ folder and choose that folder
  • To load JDK into Unity, access ‘/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/’ from your computer (exact jdk version will change over time)


  • Switch Unity platform to Android platform by going to File’ → ‘Build Settings’ → ‘Android’ → ‘Switch Platforms’. See Figure 6.
Note: Click ‘Add Open Scene’ to add your scene into the build


external image image?w=382&h=361&rev=17&ac=1
Figure 6: Switching Unity platform to Android platform
  • Access Editor Setting. Click ‘Edit’ → ‘Project Settings’ → ‘Editor’. Change Device to ‘Any Android Device’. See Figure 7.


external image image?w=227&h=267&rev=7&ac=1
Figure 7: Configure Editor Settings
  • Configure Player Settings. Player Settings can be accessed from ‘File’ → ‘Build Settings’ → ‘Player Settings’. See Figure 8.


external image image?w=382&h=361&rev=1&ac=1
Figure 8: How to access Player Settings
  • Input ‘Company Name’, ‘Product name’, and ‘Bundle Identifier’. IMPORTANT:In ‘Bundle Identifier’, the name MUST be in this format: com.(Company Name).(Product Name). Company and product name must be identical with the ‘Bundle Identifier’. See Figure 9.


external image image?w=240&h=401&rev=10&ac=1
Figure 9: Configuring Player Settings

Exporting Unity to Android Platform

  • To export Unity model into Android platform, click ‘File’ → ‘Build Settings’ → ‘Android’ → ‘Build & Run’

If building for GearVR, you need to also make sure you put your oculus signature file in your project:

  • Open terminal on your Mac, navigate to your android sdk folder-> platform-tools, then type ./adb devices, you will get a devices id.
  • Go to : https://developer.oculus.com/osig/ and download the signature to
    YourProjectName --- > assets --> Plugins ---> android ---> assets.

Note:
  • Make sure that Prefabs for ‘Cross Platform Input’ is loaded into the scene. These prefabs can be accessed from standard assets.
  • Make sure that USB is connected to the Android Device





How to Export Unity Models Into Android Application (Windows)


In order to export Unity into Android application, there are several steps that need to be done:

Install Android SDK

Note: Make sure you scroll down the webpage and look for ‘Get just the command line tools’


external image image?w=624&h=254&rev=15&ac=1
Figure 1: How to find the correct SDK tool package for Windows
  • Download the .exe for Windows

  • To install the SDK tools package into your system, double-click the .exe file that you just downloaded. Follow the instructions to install Android SDK tools. Choose ‘Install for anyone using this computer’. See Figure 2.
Note: Take note of the ‘Destination Folder’ as we will need this information in order to map it to Unity.


external image image?w=308&h=472&rev=21&ac=1
Figure 2: How to install SDK tools package into your computer system
  • After installation, it will bring up the Android SDK Manager window. See Figure 3.
Note: Make sure that at least one Android platform with API level equal to or higher than 9, Platform Tools, and Google USB Drivers are selected and installed

external image image?w=624&h=479&rev=17&ac=1
Figure 3: What to install from Android SDK Manager

Download Suitable Driver for your Device

external image image?w=450&h=418&rev=32&ac=1
Figure 4: How to find suitable OEM drivers for your device
  • Click the designated website (based on the type of your Android device) and install the appropriate USB driver.

Note: This step is very important as without appropriate driver, your Unity model will not run on your Android device.

Install JDK


external image image?w=357&h=490&rev=13&ac=1
Figure 5: Download and Installing JDK

Android Device Configuration

  • Turn your android phone from Standard Mode to Developer Mode by:
    • Access Settings → System → About Device → Build Number (Tap 7 times). This will change your phone from Standard Mode to Developer Mode

  • Turn on USB Debugging in your android phone by (ONLY work when you are in Developer Mode)
    • Access Settings → System → Developer Options → Enable ‘USB debugging’

Configuring Settings in Unity to Make It Compatible to Android System

  • Check that the SDK and JDK are properly loaded into Unity by clicking ‘Edit’ → ‘Preferences’ → ‘External Tools’. See Figure 6.


external image image?w=385&h=332&rev=13&ac=1
Figure 6: Check SDK and JDK is properly loaded to Unity
  • Switch Unity platform to Android platform by going to ‘File’ → ‘Build Settings’ → ‘Android’ → ‘Switch Platforms’. See Figure 7.
Note: Click ‘Add Open Scene’ to add your scene into the build

external image image?w=285&h=276&rev=19&ac=1
Figure 7: Switching Unity platform to Android platform
  • Access Editor Setting. Click ‘Edit’ → ‘Project Settings’ → ‘Editor’. Change Device to ‘Any Android Device’. See Figure 8.


external image image?w=227&h=267&rev=1&ac=1
Figure 8: Configure Editor Settings
  • Configure Player Settings. Player Settings can be accessed from ‘File’ → ‘Build Settings’ → ‘Player Settings’. See Figure 9.


external image image?w=325&h=314&rev=16&ac=1
Figure 9: How to access Player Settings
  • Input ‘Company Name’, ‘Product name’, and ‘Bundle Identifier’. IMPORTANT:In ‘Bundle Identifier’, the name MUST be in this format: com.(Company Name).(Product Name). Company and product name must be identical with the ‘Bundle Identifier’. See Figure 10.


external image image?w=200&h=333&rev=1&ac=1
Figure 10: Configuring Player Settings

Exporting Unity to Android Platform


  • To export Unity model into Android platform, click ‘File’ → ‘Build Settings’ → ‘Android’ → ‘Build’


Note:
  • Make sure that Prefabs for ‘Cross Platform Input’ is loaded into the scene. These prefabs can be accessed from standard assets.
  • Make sure that USB is connected to the Android Device